package com.jd.tank.abstractfactory;

import com.jd.tank.*;

/**
 * @program: MyTank
 * @description:
 * @author: 王术平
 * @create: 2021-01-13 18:11
 **/
public class DefaultFactory extends BaseGameFactory {

    private static final DefaultFactory defaultFactory = new DefaultFactory();

    private DefaultFactory() {
    }

    public static DefaultFactory getDefaultFactory() {
        return defaultFactory;
    }


    /**
     * 创建坦克
     */
    @Override
    public BaseTank createTank(int x, int y, Direction dir, Group group, TankFrame tf, boolean moving) {
        return new Tank(x, y, dir, group, tf, moving);
    }

    /**
     * 创建子弹
     */
    @Override
    public BaseBullet createBullet(int x, int y, Direction dir, Group group, TankFrame tf) {
        return new Bullet(x, y, dir, group, tf);
    }

    /**
     * 创建爆炸特效
     */
    @Override
    public BaseExplode createExplode(int x, int y) {
        return new Explode(x, y);
    }
}
